import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(title: Text('Flutter Demo')),
            //body内容多抽离出去
            body: HomeContent()));
  }
}

//body
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return LayoutDemo();
  }
}

//layoutdemo
class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        Row(
          children: <Widget>[
            Expanded(
              child: Container(
                height: 180,
                color: Colors.black,
                child: Center(
                  child: Text(
                    '您好，Flutter', 
                    textAlign: TextAlign.center, 
                    style: TextStyle(
                      color: Colors.white,
                      fontSize: 50
                    )
                  )                 
                )
              )
            )
          ],
        ),
        SizedBox(height: 10),
        Row(
          children: <Widget>[
            Expanded(
              flex: 2,
              child: Container(
                height: 180, 
                child: Image.network('https://www.itying.com/images/flutter/2.png', fit: BoxFit.cover),
              )
            ),
            SizedBox(width: 10),
            Expanded(
              flex: 1,
              child: Container(
                height: 180, 
                child: ListView(
                  children: <Widget>[
                     Container(
                      height: 85, 
                      child: Image.network('https://www.itying.com/images/flutter/3.png', fit: BoxFit.cover),
                     ),
                     SizedBox(height: 10),
                     Container(
                      height: 85, 
                      child: Image.network('https://www.itying.com/images/flutter/4.png', fit: BoxFit.cover),
                     )
                  ],
                )
              )
            )
          ], 
        )
      ], 
    );
  }
}
